package com.txd.mofa.adapter;

import android.util.DisplayMetrics;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.txd.mofa.R;

import java.util.Map;

public class TupianAdapter extends BaseQuickAdapter<Map<String, String>, BaseViewHolder> {

    public TupianAdapter(int layoutResId) {
        super(layoutResId);
    }


    @Override
    protected void convert(BaseViewHolder helper, Map<String, String> item) {

        LinearLayout ll = helper.getView(R.id.ll);

        ImageView iv = helper.getView(R.id.iv);

        DisplayMetrics dm2 = mContext.getResources().getDisplayMetrics();
        System.out.println("heigth2 : " + dm2.heightPixels);
        System.out.println("width2 : " + dm2.widthPixels);

        ll.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,dm2.heightPixels));

//        ViewGroup.LayoutParams layoutParams = ll.getLayoutParams();
//        layoutParams.height = dm2.heightPixels;

//        iv.setLayoutParams(new LinearLayout.LayoutParams(200,200));

    }
}
